home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3dm / audio / alSelectEvents.z / alSelectEvents
Encoding:
Text File  |  1998-10-20  |  7.7 KB  |  133 lines

  1.  
  2.  
  3.  
  4. aaaallllSSSSeeeelllleeeeccccttttEEEEvvvveeeennnnttttssss((((3333ddddmmmm))))                                        aaaallllSSSSeeeelllleeeeccccttttEEEEvvvveeeennnnttttssss((((3333ddddmmmm))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      alSelectEvents - Setup event queue to receive audio events.
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////aaaauuuuddddiiiioooo....hhhh>>>>
  13.  
  14.      iiiinnnntttt aaaallllSSSSeeeelllleeeeccccttttEEEEvvvveeeennnnttttssss((((AAAALLLLeeeevvvveeeennnnttttQQQQuuuueeeeuuuueeee eeeevvvveeeennnnttttqqqq,,,, iiiinnnntttt rrrreeeessssoooouuuurrrrcccceeee
  15.                          iiiinnnntttt ****ppppaaaarrrraaaammmmssss,,,, iiiinnnntttt nnnnppppaaaarrrraaaammmmssss))))
  16.  
  17. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRR
  18.      _e_v_e_n_t_q   expects an AAAALLLLeeeevvvveeeennnnttttQQQQuuuueeeeuuuueeee structure properly initialized by
  19.               aaaallllOOOOppppeeeennnnEEEEvvvveeeennnnttttQQQQuuuueeeeuuuueeee((((3333ddddmmmm)))).
  20.  
  21.      _r_e_s_o_u_r_c_e expects a resource ID from which you desire events.
  22.  
  23.      _p_a_r_a_m_s   expects an int pointer with a list of parameters for which you
  24.               desire events.
  25.  
  26.      _n_p_a_r_a_m_s  expects an int with the total number of parameters in the list
  27.               _p_a_r_a_m_s.
  28.  
  29.  
  30. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  31.      aaaallllSSSSeeeelllleeeeccccttttEEEEvvvveeeennnnttttssss((((3333ddddmmmm)))) sets up _e_v_e_n_t_q to receive audio events from _r_e_s_o_u_r_c_e
  32.      (see aaaallllRRRReeeessssoooouuuurrrrcccceeeessss((((3333ddddmmmm))))). An event will be generated whenever the value of
  33.      a parameter from _p_a_r_a_m_s changes on the given resource.  Please refer to
  34.      aaaallllPPPPaaaarrrraaaammmmssss((((3333ddddmmmm)))) for a complete list of parameters that can generate events.
  35.      To retrieve events, use aaaallllNNNNeeeexxxxttttEEEEvvvveeeennnntttt((((3333ddddmmmm)))) and aaaallllCCCChhhheeeecccckkkkEEEEvvvveeeennnntttt((((3333ddddmmmm)))).
  36.  
  37.      You can call aaaallllSSSSeeeelllleeeeccccttttEEEEvvvveeeennnnttttssss((((3333ddddmmmm)))) several times on an event queue. Thus a
  38.      single event queue can monitor events from multiple resources.
  39.  
  40.      In some cases, the resource that generates an event will differ from the
  41.      resource specified in aaaallllSSSSeeeelllleeeeccccttttEEEEvvvveeeennnnttttssss. As noted in aaaallllPPPPaaaarrrraaaammmmssss((((3333ddddmmmm)))),
  42.      parameters addressed to one resource can be passed on to other resources.
  43.      For example, an AL_RATE passed to a device is actually handled by the
  44.      device's clock-generator, a separate resource. In this case, if you
  45.      request AL_RATE events from the device, you will be notified when the
  46.      value of AL_RATE changes on the device's clock-generator; both resource
  47.      ID's will show up in the event. Refer to aaaallllGGGGeeeettttEEEEvvvveeeennnnttttSSSSrrrrccccRRRReeeessssoooouuuurrrrcccceeee((((3333ddddmmmm)))) and
  48.      aaaallllGGGGeeeettttEEEEvvvveeeennnnttttRRRReeeessssoooouuuurrrrcccceeee((((3333ddddmmmm)))) for more information.
  49.  
  50.      Event queues monitoring either AAAALLLL____DDDDEEEEFFFFAAAAUUUULLLLTTTT____IIIINNNNPPPPUUUUTTTT or AAAALLLL____DDDDEEEEFFFFAAAAUUUULLLLTTTT____OOOOUUUUTTTTPPPPUUUUTTTT will
  51.      change to monitor the new device when the default is changed. Note that
  52.      events with certain parameters will cease to be generated due to the
  53.      characteristics of the new resource.
  54.  
  55.      To deselect event notification on an event queue, use
  56.      aaaallllDDDDeeeesssseeeelllleeeeccccttttEEEEvvvveeeennnnttttssss((((3333ddddmmmm)))).
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. aaaallllSSSSeeeelllleeeeccccttttEEEEvvvveeeennnnttttssss((((3333ddddmmmm))))                                        aaaallllSSSSeeeelllleeeeccccttttEEEEvvvveeeennnnttttssss((((3333ddddmmmm))))
  71.  
  72.  
  73.  
  74. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  75.      The following example sets up an event queue to receive events with
  76.      either AL_RATE or AL_MUTE parameters from the default output device.
  77.  
  78.           int params[2];
  79.           ALeventQueue eventq;
  80.  
  81.           /*
  82.            * Open event queue and set it up to receive events.
  83.            */
  84.  
  85.           eventq = alOpenEventQueue("output");
  86.  
  87.           if(eventq == NULL) {
  88.               fprintf(stderr,"Open event queue failed \n");
  89.               return -1;
  90.           }
  91.  
  92.           params[0] = AL_RATE;
  93.           params[1] = AL_MUTE;
  94.  
  95.           status = alSelectEvents(eventq,AL_DEFAULT_OUTPUT,params,2);
  96.  
  97.           if(status == -1) {
  98.               fprintf(stderr,"Select event queue failed \n");
  99.               return -1;
  100.           }
  101.  
  102.  
  103.  
  104. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  105.      Upon successful completion, aaaallllSSSSeeeelllleeeeccccttttEEEEvvvveeeennnnttttssss returns 0. Otherwise,
  106.      aaaallllSSSSeeeelllleeeeccccttttEEEEvvvveeeennnnttttssss returns -1 and sets an error number which can be retrieved
  107.      with oooosssseeeerrrrrrrroooorrrr((((3333CCCC)))).
  108.  
  109.      aaaallllSSSSeeeelllleeeeccccttttEEEEvvvveeeennnnttttssss can fail for the following reason:
  110.  
  111.      AAAALLLL____BBBBAAAADDDD____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEEVVVVEEEENNNNTTTTQQQQ    _e_v_e_n_t_q is either invalid or null.
  112.      AAAALLLL____BBBBAAAADDDD____RRRREEEESSSSOOOOUUUURRRRCCCCEEEE         _r_e_s_o_u_r_c_e is invalid.
  113.      AAAALLLL____BBBBAAAADDDD____PPPPAAAARRRRAAAAMMMM             _p_a_r_a_m_s is either invalid or null.
  114.      AAAALLLL____BBBBAAAADDDD____BBBBUUUUFFFFFFFFEEEERRRRLLLLEEEENNNNGGGGTTTTHHHH____NNNNEEEEGGGG  _n_p_a_r_a_m_s is either less than or equal to zero.
  115.  
  116. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  117.      alOpenEventQueue(3dm), alDelectEvents(2), alParams(3dm),
  118.      alNextEvent(3dm), alCheckEvent(3dm), alGetEventResource(3dm),
  119.      alGetEventSrcResource(3dm), oserror(3C)
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.